﻿using System.Diagnostics;

namespace HQS.TokenInterpolation.Tokens
{
    [Token(Name = "foreach")]
    [DebuggerDisplay(
        "Token {Name} Format {Format} OriginalText {OriginalText} Target {Target} TemplateName {TemplateName}")]
    public class ForEach : AbstractToken, IVisitableTemplate
    {
        [TokenProperty("this")]
        public string This { get; set; }

        public Template Template { get; set; }

        [TokenProperty("template")]
        public string TemplateName { get; set; }

        protected override TokenRuntimeValue OnAccept(IDataSourcesVisitor runtimeContext)
        {
            return runtimeContext.Visit(this);
        }
    }
}